﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Shove.Web.UI;

public partial class UserControls_Welcome :UCBase 
{
    public UserControls_Welcome()
    {
        Name = "欢迎语";

        swpas = new ShoveWebPartAttribute[11];

        swpas[0] = new ShoveWebPartAttribute_Int("控件宽度", "1,1004", 759, "控件宽度");
        swpas[1] = new ShoveWebPartAttribute_Int("导航单元格高度", "1,500", 23, "导航单元格高度");
        swpas[2] = new ShoveWebPartAttribute_Int("导航单元格宽度", "1,600", 102, "导航单元格宽度");
        swpas[3] = new ShoveWebPartAttribute_Int("欢迎语行高", "1,300", 25, "欢迎语行高");
        swpas[4] = new ShoveWebPartAttribute_Text("登陆用户名样式", "", "blue12", "登陆用户样式");

        swpas[5] = new ShoveWebPartAttribute_Color("控件边框颜色", "#cccccc", "控件边框颜色");
        swpas[6] = new ShoveWebPartAttribute_Text("欢迎语样式", "","td12", "欢迎语样式");

        swpas[7] = new ShoveWebPartAttribute_Image("导航背景图片1", "", "images/bg_hui_23.jpg", "导航背景图片1");
        swpas[8] = new ShoveWebPartAttribute_Image("导航背景图片2", "", "images/bg_hui_23_2.jpg", "导航背景图片2");

        swpas[9] = new ShoveWebPartAttribute_Text("导航文本样式", "", "white12_2", "导航文本样式");
        swpas[10] = new ShoveWebPartAttribute_Text("退出样式", "", "blue12", "退出样式");
    }

    private void Initlayout()
    {
        //tabctr.Width = swpAttributes[0];
        //tabctr.BgColor = swpAttributes[5];

        //tdsign.Width = swpAttributes[2];
        //tdsign.Height = swpAttributes[1];
        //tdsign.Style.Add("background-image", "url('" + swpAttributes[7] + "')");
        //tdsign.Attributes.Add("class", swpAttributes[9]);

        //tdspace.Style.Add("background-image", "url('" + swpAttributes[8] + "')");

        //tdcontent.Height = swpAttributes[3];
        //tdcontent.Attributes.Add("class", swpAttributes[6]);
        //lbUserName.CssClass = swpAttributes[4];
        //alink.Attributes.Add("class", swpAttributes[10]);
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (_Customer == null)
        {
            lbExit.Visible = false;
            lbUserName.Visible = false;
        }
        else
        {
            lbUserName.Text = _Customer.CustomerNO;
        }

        Initlayout();
    }

    protected void lbExit_Click(object sender, EventArgs e)
    {
        Session.RemoveAll();
        Response.Redirect("Default.aspx");
    }
}
